<template>
	<view class="bg-white u-padding-20">
		<u-navbar  :title="info.name" :autoBack="true" safeAreaInsetTop fixed placeholder />
			<!-- <uni-card :cover="cover" title="课程信息" padding="0"> -->
				<view>
					<u-cell-group>
						<!-- <u-cell center :arrow="false" title="课程名称">
							<view class="u-font-md text-black" slot="value">{{info.name}}</view>
						</u-cell> -->
						
						<u-cell center :arrow="false" title="所属科目">
							<view class="u-font-md text-black" slot="value">{{info.subjectName}}</view>
						</u-cell>
						
						<u-cell center :arrow="false" title="课程类型">
							<view class="u-font-md text-black" slot="value">
								 <dict-tag :type="lessonType" :value="info.lessonType"/>
							</view>
						</u-cell>
						
						<u-cell center :arrow="false" title="课次数">
							<view class="u-font-md text-black" slot="value">{{info.lessonCount}}</view>
						</u-cell>
						
						<u-cell center :arrow="false" title="价格">
							<view class="u-font-md text-black" slot="value">{{info.price}}元</view>
						</u-cell>
						
						<u-cell center :arrow="false" title="有效期">
							<view class="u-font-md text-black" slot="value">{{info.expireMonths}}个月</view>
						</u-cell>
						
						<u-cell center :arrow="false" title="备注">
							<view class="u-font-md text-black" slot="value" v-html="info.description" />
						</u-cell>
					</u-cell-group>
				</view>
			<!-- </uni-card> -->
	</view>
</template>
<script>
	import request from '@/utils/request'
	export default {
		components: {
		},
		data() {
			return {
				lessonType: this.$dictType.EDU_LESSON_TYPE,
				courseId: '',
				info: {},
			}
		},
		onLoad(option) {
			this.courseId = option.courseId
			this.getInfo()
		},
		methods: {
			getInfo() {
				request({url:'/erp/course/get', data:{
					id: this.courseId
				}}).then(res => {
					if (!this.$common.handleResponseMsg(res)) return;
					this.info = res.data
				});
			},
			clickLeft() {
				uni.navigateTo({
					url: '/pages/course/index'
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.line-height-md {
		line-height: 35px;
		height: 35px;
	}
</style>
